package com.personal.system.service.sys;

import com.personal.common.result.Result;
import com.personal.model.system.SysUser;
import com.personal.model.vo.LoginVo;
import com.personal.model.vo.SysUserQueryVo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.personal.system.entity.vo.EmailLoginDTO;
import me.zhyd.oauth.model.AuthResponse;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 用户表 服务类
 * </p>
 *
 * @author personal
 * @since 2022-09-28
 */
public interface SysUserService extends IService<SysUser> {

    //用户列表
    IPage<SysUser> selectPage(Page<SysUser> pageParam, SysUserQueryVo sysUserQueryVo);

    //更改用户状态
    void updateStatus(String id, Integer status);

    //username查询
    Object getToken(LoginVo loginVo);

    //根据用户名称获取用户信息（基本信息 和 菜单权限 和 按钮权限数据）
    Map<String, Object> getUserInfo(String username);

    SysUser getUserInfoByUserName(String username);

    void logout(HttpServletRequest request);

    List<SysUser> selectList(SysUserQueryVo sysUserQueryVo);

    ///////////////////////////////////////WEB登陆///////////////////////////////////////////////////////
    Result emailLogin(EmailLoginDTO emailLoginDTO);


    Result selectUserInfoByToken(String token);

    void authLogin(AuthResponse response, String source, HttpServletResponse httpServletResponse) throws IOException;

}
